ImagXpress® provides methods and properties to support cleanup of photo and document images.
Binarize
To facilitate cleanup or image recognition, it may be useful to convert an image to a 1-bit or 8-bit gray scale image. The Binarize and AutoBinarize methods operate on 8-bit and 24-bit input DIB's, permanently modifying it to a 1-bit or 8-bit gray scale DIB of the same dimensions. The Autobinarize method operates on 1-bit and 24-bit input images, automatically selecting the optimal binarize parameters to convert to a 1-bit monochrome image.
Deskew
To adjust the rotation of the page to remove skew, use one of the following:
- Document: If the image is a black and white document, you may wish to use the DocumentDeskew method, which has been optimized for 1-bit images and which provides feedback on confidence in the result (IPConfidence property) and rotation angle required to correct the skew (IPRotationAngle property).
Shear
To adjust the rotation of the body of the image, use:
- Document: Use the DocumentShear method to correct rotation within the body of the image text. (For example, if an image, like a page of a book, was not flat when scanned, the resulting digital image text may be skewed. The Deskew method will correct rotation of the entire page, but will not address skew within the text body of the image. In this instance Shear may be a more useful method.)
Remove specks or blobs
To eliminate small specks or larger black objects, use one of the following:
- General: The Despeckle method removes black specks from an image.
-
Document: If the image is a black and white document, you may wish to use on of the following:
- Photo: If the image is a photo, you may wish to use the RemoveDust method, which has been optimized to remove black or white specks from color images. (Note: You must define an area to be processed, using the Area method prior to using the RemoveDust method.
Remove lines or scratches
To eliminate lines or scratches from the image, use one of the following:
- Document: If the image is a black and white document, use the DocumentLineRemoval method. This method sets the IPCountOfLinesFound property.
- Photo: If the image is a photo, use the RemoveScratches method to remove scratches from the image. (Note: You must define an area to be processed, using the Area method prior to using the RemoveScratches method.)
Identify blank pages
Clarify Letters and Lines
ImagXpress offers a number of methods, aimed at clarifying and smoothing letters and lines. They are:
Dilate
- General: To enhance/fill in divots in black letters and lines, use Dilate.
- Document: If the image is black and white, you can use the DocumentDilate method, which has been enhanced for black and white images.
Erode
- General: To reduce/erase protrusions from black letters and lines, use Erode.
- Document: If the image is black and white, you can use the DocumentErode method, which has been enhanced for black and white images.
Smooth
- Document: If the image is black and white, you can use the DocumentZoomSmooth method. This method smoothes letters and lines, by first doubling their width and height, then dilating and eroding as required.
Remove edges or borders
-
General: To remove borders of an image, use one of the following methods:
- Crop borders using the CropBorder method, specifying the type of crop (cropType) and threshold for recognizing the border (percentToCrop).
- Automatically crop edge space from an image, using the AutoCrop method.
- Document: If the image is black and white, the DocumentBorderCrop method can be used to automatically crop the borders of the document. This method has been enhanced for black and white images and sets the IPConfidence property to indicate the confidence of the DocumentBorderCrop result.
See Also